package controller.entity;

/**
 * Created by asus on 2017/6/19.
 */
public class Page {
    private Integer page;
    private Integer rows;
    private Integer firstPage=1;  //第几条记录起始

    public Page() {
    }

    public Page(Integer page, Integer rows, Integer firstPage) {
        this.page = page;
        this.rows = rows;
        this.firstPage = firstPage;
    }

    public Integer getPage() {
        if(null==this.page||this.page<1){
            this.page=1;
        }
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        if(null==this.rows||this.rows<1){
            this.rows=20;
        }
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public Integer getFirstPage() {
        return firstPage;
    }

    public void setFirstPage(Integer firstPage) {
        this.firstPage = firstPage;
    }

    @Override
    public String toString() {
        return "Page{" +
                "page=" + page +
                ", rows=" + rows +
                ", firstPage=" + firstPage +
                '}';
    }
}
